//
//  Function.h
//  QRMaster
//
//  Created by liuyunlong on 15/12/21.
//  Copyright © 2015年 myApple. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface Function : NSObject

//另一种打印输出
//#ifdef DEBUG
//#define DLog (fmt, ... ) NSLog((@"[文件名:%s]\n" "[函数名:%s]\n" "[行号:%d]\n" fmt), __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__);
//#else
//#define DLog (...);
//#endif


//打印输出
#ifdef DEBUG

#define DDLOG(...) NSLog(__VA_ARGS__)
#define DDLOG_CURRENT_METHOD NSLog(@"%@-%@", NSStringFromClass([self class]), NSStringFromSelector(_cmd))

#else

#define DDLOG(...) ;
#define DDLOG_CURRENT_METHOD ;

#endif

//RGB color macro
#define UIColorFromRGB(rgbValue1) [UIColor colorWithRed:((float)((rgbValue1 & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue1 & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue1 & 0xFF))/255.0 alpha:1.0]

//RGB 加透明度
#define UIColorFromRGBAndA(rgbValue1,a) [UIColor colorWithRed:((float)((rgbValue1 & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue1 & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue1 & 0xFF))/255.0 alpha:a]

//RBG color
#define RGBA(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
#define RGCOLOR RGBA(255,255,255)
#define LINERGBA(alpha) [UIColor colorWithRed:224/255.0 green:224/255.0 blue:224/255.0 alpha:alpha]
@end
